<template>
  <Drawer
    title="操作记录"
    width="20%"
    placement="right"
    :scrollable="true"
    v-model="showHostory"
    :mask="false"
    :draggable="true"
  >
    <div style="width: 100%; height: 2250px; padding: 20px">
      <Timeline>
        <TimelineItem v-for="(item, index) in historyList" :key="index">
          {{ item.actionTime }}
          <div style="margin-top: 20px">操作： {{ item.type == 1 ? '通过' : '驳回' }}</div>
          <div v-if="item.type === -1">驳回理由： {{ item.memo }}</div>
          <div>用户： {{ item.userName }}</div>
        </TimelineItem>
      </Timeline>
    </div>
  </Drawer>
</template>
<script setup>
import http from '@/util/http'
const showHostory = ref(false)
const historyList = ref([])

const openHostory = (id) => {
  showHostory.value = true
  http.get('/Settlement/List/CheckItems?listID=' + id, {}, (response) => {
    historyList.value = response.data.data
  })
}

defineExpose({
  openHostory,
})
</script>
<style scoped>
.hx {
  border-bottom: 1.5px solid;
  padding-left: 2px;
  text-align: center;
  /* font-weight: bold; */
  /* font-family: '宋体'; */
  /* font-size: 16px; */
  /* color: black; */
}

.ivu-row {
  padding-top: 10px;
}

.underline {
  text-decoration: underline;
  text-underline-offset: 0.5em;
}
</style>
